#!usr/bin/env python
# -*- coding:utf-8 -*-
# user nanme: Mr.zhang
# data time : 2022/9/20   10:51 上午
# project   : test.py
# IDE       : PyCharm
# email     :17600960626@163.com
import json
import os
import re
import uiautomator2 as u2

d = u2.connect()

def find_xp(a):
    d.exists()
    xp = d.xpath(a).click()
    print(type(xp))
    return xp

find_xp('//*[@content-desc="隐藏键盘"]')

import json
import os

def send_char(text):
    path = os.path.dirname(os.path.abspath(__file__))
    path_name = path+'/layout/pro_26键'
    with open(path_name) as f:
        a=f.read()
        j = json.loads(a)
        for i in j["keys"]:
            if i['code'] == text:
                return i["x"],i['y']

def suns():
    a = 0
    s = 0.240
    while a < 10:
        b = s+0.088
        result = "%.3f"%b
        print(result)
        a+=1
        s=b


if __name__ == '__main__':
    suns()
    # text="copy"


